//
//  leixing.m
//  BAOASystem
//
//  Created by michael on 2018/5/30.
//  Copyright © 2018年 czd. All rights reserved.
//

#import "leixing.h"
@interface leixing ()
@property(nonatomic,strong)UIButton * selectedButton;
@property (weak, nonatomic) IBOutlet UIButton *noOrder;

@end
@implementation leixing
- (IBAction)didCheckBox:(id)sender {
 UIButton * btn = (UIButton*)sender;
    self.selectedButton.selected = NO;
    btn.selected = YES;
    self.selectedButton = btn;
    self.orderString = [NSString stringWithFormat:@"%ld",(long)btn.tag];
    if (self.selectRowBlock) {
       self.selectRowBlock(self.orderString);
    }
}


-(void)awakeFromNib{
[_qiugou setTitle:NSLocalizedString(@"求购", nil) forState:UIControlStateNormal];
[_hezuo setTitle:NSLocalizedString(@"合作", nil) forState:UIControlStateNormal];
[_xiaoshou setTitle:NSLocalizedString(@"销售", nil) forState:UIControlStateNormal];

    self.autoresizingMask = UIViewAutoresizingNone;
    if ([[NSString stringWithFormat:@"%ld",(long)_seltag]isEqualToString:@"0"]) {
        [self didCheckBox:self.noOrder];

}else{
  UIButton *button = (UIButton *)[self viewWithTag:_seltag];
    [self didCheckBox:button];
  }
    

   
}
- (void)setSeltag:(NSInteger)seltag
{
_seltag = seltag;
_orderString = [NSString stringWithFormat:@"%ld",(long)_seltag];
[self awakeFromNib];
}
+(instancetype)checkBoxFootView{
    return [[[NSBundle mainBundle] loadNibNamed:@"leixing" owner:nil options:nil] lastObject];
}


@end
